<div class="row">
    <div class="col-md-12 widget-module">
        <div class="box-widget">
            <div class="widget-head clearfix">
                <h4 class="pull-left"><?php echo $this->customer['name']; ?></h4>
            </div>
            
            <div class="widget-container">
                <div class="widget-block">
                    <div class="widget-content">
                        <form id="usergroup" method="post" class="form-horizontal form-box">
                            <div class="form-group <?php echo $this->classError['dept']; ?>">
                                <label class="col-lg-2 control-label"><?php echo $this->translate('credit'); ?></label>
                                <div class="col-lg-4">
                                    <input id="dept" class="form-control" type="text" value="<?php echo $this->dept; ?>" class="form-control" placeholder="<?php echo $this->translate('credit'); ?>" />
                                    <input type="hidden" value="" name="dept" />
                                    <?php echo $this->messageError['dept']; ?>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-lg-2 control-label">&nbsp;</label>
                                <div class="col-lg-4">
                                    <div class="form-actions">
                                        <button type="submit" class="btn btn-primary">
                                            <i class="icon-save"></i>
                                            <?php echo $this->translate('save'); ?>
                                        </button>
                                        <button id="cancel" type="button" class="btn">
                                            <i class="icon-cancel-circle-2"></i>
                                            <?php echo $this->translate('cancel'); ?>
                                        </button>
                                    </div>
                                </div>
                            </div> 
                            <input type="hidden" name="save" value="1" />
                            <input type="hidden" name="customer_id" value="<?php echo $this->customer['id']; ?>" />
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
var optionNumeric = {'aSep': '.', 'aDec': ',', 'mDec': 0, 'vMin': 0, 'vMax': 99999999999, 'wEmpty': 'zero'};

$("#cancel").click(function(){
    window.location = "<?php echo $this->url(array('module' => 'admin', 'controller' => 'sales-invoice', 'action' => 'dept'), null, true); ?>";
});

$(document).ready(function(){
    $("#dept").autoNumeric('init', optionNumeric);
    
    $("#dept").change(function(){
        var dept = $(this).autoNumeric('get');
        
        $("input[name='dept']").val(dept);
    });
});
</script>